-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix blank screen is shown when opening a report screen after relaunching app #37596
Fix blank screen is shown when opening a report screen after relaunching app #37596
Conversation
if (isEmptyObject(report)) { | ||
optimisticData[0].onyxMethod = Onyx.METHOD.SET; | ||
} | ||
|
There are 2 issues left however and they have the same issue too.
The report name is overwritten with the default name here because the onyx data is not ready yet. App/src/libs/actions/Report.ts Lines 572 to 576 in 39a257d
so we can avoid calling OpenReport. App/src/pages/home/ReportScreen.js Lines 355 to 362 in 39a257d
However, the report data is not available immediately. The We can fix this using |
Just finished several pending migration PRs in these days, I expect to have time tomorrow to revisit the above problems. :) |
Still investigating the related issues. |
Or perhaps we should remove the |
Hi, @bernhardoj, Did you mean that we only need to remove
As for this part, we had a discussion in other places and felt that it is better to avoid using the |
Hmm, the only idea left I have is to replace |
Thank you! I'll investigate this solution next week. |
I'm experimenting with switching to |
test.mp4The investigation into the issue is still progressing slowly. It seems there is still some delay when the report is opened first. In my previous tests, there have been instances where the skeleton didn't appear immediately, and sometimes the header didn't show up right away either. This week, I'll focus on this issue and another refocusing issue. Also, if necessary, will seek more inputs in the performance channel. :) |
Based on the video, looks like the report screen is rendered immediately as shown by the (broken) composer, I will check it too tomorrow to see if I can reproduce and find something about it. |
App/src/libs/actions/Report.ts Line 680 in 1abbf42
This line of code was introduced here, and I'm also testing to remove it. |
So far, using Regarding the broken composer, I think it also occurs in the production environment, so we can ignore it for now. test.mp4 |
I think we can keep it like that. To solve the name issue in my comment here, I update the code to call OpenReport only after the report onyx is loaded. I think we can convert only some of the onyx data to |
Vacation is over, time to tackle this challenge again. 😂 In my test, the middle list area still shows a blank screen. maybe we can show the skeleton instead? test.mp4 |
Ok I can reproduce the blank list. I checked the onyx data of ReportActionsView App/src/pages/home/report/ReportActionsView.tsx Lines 622 to 633 in 7ef8e8c
and it's the |
src/pages/home/ReportScreen.tsx
Outdated
@@ -489,6 +467,16 @@ function ReportScreen({ | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
}, []); | |||
|
|||
useEffect(() => { | |||
// Call OpenReport only if we are not linking to a message or the report is not available yet | |||
if (reportResult.status === 'loading' || (reportActionIDFromRoute && report.reportID)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better now! Also, just a minor change request, we have an isLoadingOnyxValue
util function, so defining a variable might be better than using reportResult.status
directly.(e.g., const isLoadingReportOnyx = isLoadingOnyxValue(reportResult)
, which will help clean up the logic of this component in the future. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nice one. Updated.
Btw, I'm still considering whether to include the report onyx loading state to App/src/pages/home/ReportScreen.tsx Line 393 in a03fecc
I think we should add it. Do you agree? |
I've also attempted something similar before. This might involve cleaning up the loading related code. I'll first ask about it on Slack. :) |
Hi @bernhardoj, after discussion, we've decided not to make further changes for now, The loading and other |
Thanks for the updated! Merged with main |
Reviewer Checklist
Screenshots/VideosAndroid: Native37596-android-native.mp4Android: mWeb Chrome37596-android-chrome.mp4iOS: Native37596-ios-native.mp4iOS: mWeb Safari37596-ios-safari.mp4MacOS: Chrome / Safari37596-web.mp4MacOS: Desktop37596-desktop.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. :)
Additionally, A and C are online cases, B is offline. And B, C are regression cases that were reported previously.
B.mp4
C.mp4
All yours, @yuwenmemon. I haven't returned to the assignment queue, so the automatic assignment hasn't taken effect. :) |
Thanks! |
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 1.4.77-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
Details
The
withOnyx
returnsnull
when the data is still loading. We already put someinitialValue
to the required onyx data, but Onyx has a bug that doesn't accept falseyinitialValue
. This PR also fixes some App issue that arise after fixing the onyx bug.Fixed Issues
$ #35906
PROPOSAL: #35906 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
A.
B.
C.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-02-14.at.13.58.29.mov
New.Expensify.Dev.1.mp4
Android: mWeb Chrome
Screen.Recording.2024-02-14.at.14.01.06.mov
Screen.Recording.2024-02-27.at.16.05.34.mov
iOS: Native
Screen.Recording.2024-02-14.at.14.05.55.mov
Screen.Recording.2024-02-27.at.15.59.42.mov
iOS: mWeb Safari
Screen.Recording.2024-02-14.at.14.01.41.mov
Screen.Recording.2024-02-27.at.15.54.32.mov
MacOS: Chrome / Safari
Screen.Recording.2024-02-14.at.14.06.30.mov
Screen.Recording.2024-02-27.at.15.48.19.mov
MacOS: Desktop
Screen.Recording.2024-02-14.at.14.07.33.mov
Screen.Recording.2024-02-27.at.15.50.39.mov